<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition template="/template.xhtml">
        <ui:define name="title">
            <h:outputText value="#{bundle.EditProductTitle}"></h:outputText>
        </ui:define>
        <ui:define name="body">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>
            <h:form>
                <p:panelGrid columns="2">
                     <f:facet name="header">
                        <h:outputText value="Produtos" />
                    </f:facet>
                    <f:facet name="footer" >
                        <h:outputText value="WebApplication  "   />  <p:commandButton action="#{productController.update}" value="#{bundle.EditProductSaveLink}" />
                    </f:facet>
                    
                    <h:outputLabel value="#{bundle.EditProductLabel_description}" for="description" />
                    <h:inputText id="description" value="#{productController.selected.description}" title="#{bundle.EditProductTitle_description}" />
                    <h:outputLabel value="#{bundle.EditProductLabel_price}" for="price" />
                    <h:inputText id="price" value="#{productController.selected.price}" title="#{bundle.EditProductTitle_price}" />
                    <h:outputLabel value="#{bundle.EditProductLabel_supply}" for="supply" />
                    <h:selectOneMenu id="supply" value="#{productController.selected.supply}" title="#{bundle.EditProductTitle_supply}" >
                        <f:selectItems value="#{supplyController.itemsAvailableSelectOne}"/>
                    </h:selectOneMenu>
                   
                </p:panelGrid>
                
                
                
                <br />
                <h:link outcome="/home" value="#{bundle.EditProductIndexLink}" />
            </h:form>
        </ui:define>
    </ui:composition>

</html>
